﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;

namespace Agresso.Interface.Layer.Domain
{
    public class AGRESO_SYNC
    {
        public int AS_ID = 0;//] [int] IDENTITY(1,1) NOT NULL,
        public string AS_ACCOUNT = "";//] [varchar](150) NULL,
        public string AS_VESSEL_ACC_CODE = "";// [varchar](15) NULL,
        public string AS_VESSEL_CODE = "";//E varchar(4) NULL,
        public int AS_MONTH = 0;// int NULL,
        public int AS_YEAR = 0;// int NULL,
        public string AS_COMPANY_CODE = "";// varchar(20) NULL,
        public string AS_CURRENCY = "";// varchar(50) NULL,
        public decimal AS_AMOUNT = 0;// money NULL,
        public string AS_DESCRIPTION = "";// varchar(150) NULL,
        public int AS_ADD_BY = 0;// int NULL,
        public DateTime AS_ADD_DATE = new DateTime(1900, 1, 1);// datetime NULL,
        public int AS_IS_EXPORTED = 0;// bit NULL,
        public string AS_VESSEL_NAME = "";// varchar(30) NULL,
        public string AS_COMPANY_NAME = "";// varchar(70) NULL,
     //   public string AS_PICKUP_DATE_TIME = "";// varchar(16) NULL,

        public AGRESO_SYNC(SqlDataReader rd)
        {
            AS_ID = rd["AS_ID"] is DBNull ? 0 : Convert.ToInt32(rd["AS_ID"]);
            AS_ACCOUNT = rd["AS_ACCOUNT"] is DBNull ? "" : rd["AS_ACCOUNT"].ToString();
            AS_VESSEL_ACC_CODE = rd["AS_VESSEL_ACC_CODE"] is DBNull ? "" : rd["AS_VESSEL_ACC_CODE"].ToString();
            AS_VESSEL_CODE = rd["AS_VESSEL_CODE"] is DBNull ? "" : rd["AS_VESSEL_CODE"].ToString();
            AS_MONTH = rd["AS_MONTH"] is DBNull ? 0 : Convert.ToInt32(rd["AS_MONTH"]);
            AS_YEAR = rd["AS_YEAR"] is DBNull ? 0 : Convert.ToInt32(rd["AS_YEAR"]);
            AS_COMPANY_CODE = rd["AS_COMPANY_CODE"] is DBNull ? "" : rd["AS_COMPANY_CODE"].ToString();
            AS_CURRENCY = rd["AS_CURRENCY"] is DBNull ? "" : rd["AS_CURRENCY"].ToString();
            AS_AMOUNT = rd["AS_AMOUNT"] is DBNull ? 0 : Convert.ToDecimal(rd["AS_AMOUNT"]);
            AS_DESCRIPTION = rd["AS_DESCRIPTION"] is DBNull ? "" : rd["AS_DESCRIPTION"].ToString();
            AS_ADD_BY = rd["AS_ADD_BY"] is DBNull ? 0 : Convert.ToInt32(rd["AS_ADD_BY"]);
            AS_ADD_DATE = rd["AS_ADD_DATE"] is DBNull ? AS_ADD_DATE : Convert.ToDateTime(rd["AS_ADD_DATE"]);
            AS_IS_EXPORTED = rd["AS_IS_EXPORTED"] is DBNull ? 0 : Convert.ToInt32(rd["AS_IS_EXPORTED"]);
            AS_VESSEL_NAME = rd["AS_VESSEL_NAME"] is DBNull ? "" : rd["AS_VESSEL_NAME"].ToString();
            AS_COMPANY_NAME = rd["AS_COMPANY_NAME"] is DBNull ? "" : rd["AS_COMPANY_NAME"].ToString();
           // AS_PICKUP_DATE_TIME = rd["AS_PICKUP_DATE_TIME"] is DBNull ? "" : rd["AS_PICKUP_DATE_TIME"].ToString();
        }
    }
}
